Insecticide
Insecticide, also known as Master of Magic 1.40 is a bugfix, AI improvement and general patch developed by Kyrub. Last stable released version is 1.40n, last unstable version is 1.40o. Insecticide no longer receives updates and the developer is currently inactive. The 1.50 patch released by Seravy aims to continue this project and deal with the remaining bugs in the game. Since 1.40o was unstable and is not widely used, this page will consider the 1.40n version the final Insecticide. The following aims to be a complete list of changes contained in this update. Since the developer did not make all of their changes public, and sometimes the changelog is inaccurate or outdated, all the information below comes from disassembling and comparing the insecticide file with the 1.31 files. The location of the change in the files is listed in parentheses, with W for Wizards.exe and M for Magic.exe, and the hexadecimal address for the first byte of changed code. Note that entries saying they fix an "unknown" bug mean the Insecticide version of the code works as intended and I do not know what the problem in the 1.31 version was. (W $BC1FF) Also note that there is no guarantee this list is 100% complete, considering the vast amount of code, I most likely missed a few details. Forum thread and download for the Insecticide patch Bug fixes * Game recalculates town data whenever there are no units selected to make sure the income information is up to date and accurate. (W $43362) * Fixes Wind Walking bug, Total movement allowance of stack displayed does not always match windwalker's. (W $4A313) * Fixes : Wraith Form items do not grant Non-Corporeal movement. Unfortunately, it also introduces a new bug whereby a single Hero with a Wraith Form item grants Pathfinding to the entire stack so long as they are the last unit in the stack (only the last Hero's item flags are actually stored, and that's what every unit is checking against). (W $51B62) * Archmage retort now correctly displays the +50% SP gained. * Fixes the bug of found items in treasure being unlimited value. ($62C11) * Fixes the bug of found items in treasure requiring the wizard to have enough books to be able to create the item. ($62C11, $8D9D5) * Fixes diplomacy bug : When proposing "Declare War on", bonus for having a Wizard's Pact is not added. ($W 6400F) * Fixed one of the bugs in returning ownership of a unit after confusion. (W $6B800) * Fixes bug : Item granted Invisibility is not considered when checking for visibility of a unit during combat AI targeting (W $6D76A) * Fixes bug : Not building engineers count into building capacity - might only apply to second and later map squares in the road, not sure (W $712D5) * Units owned by the human player on the overland map cannot move through enemies unless that's the intended destination to avoid unintended combat. (W $724DD) * After strategic combat, items on heroes are no longer lost, but will be received by the winner. ($ W7318B) * Fixes bugs of how mana is being spent during Strategic Combat. (W $7F0C6) * Fixes strategic combat bug : effect of spellbooks of various realms overwrite each other instead of being added up. ($7F181) * Change to how "Defense rating" of unit is being calculated for Strategic combat and AI. (W $7FF5F) * Fixes bug : AI was able to target heroes with Possession. (W $80D8E) * Fixes some bug in Counter Magic (one variable was used for two different purposes it seems, W $837D6) * Maximal number of is limited to 4 to prevent memory corruption and crashing. (W $846F6) * Fixes bug : Dispel Evil can be cast on non-Death non-Chaos units. (W $8603D) * Fixes bug : You can target units with Life Drain even if they have Death Immunity. (W $8613C) * Back button on Create Artifact screen for item icons is removed, a new Exit button is added. Necessary because the back button causes crashes. (W $8C304) * Fixes : from Chaos Channels is applied twice. (W $90A0C) * Fixes : Some spells are missing from heroes (W $913A3) * Overland spells no longer treat units as Normal Units. (W $986D7) * Cloak of Fear now affects the correct unit. (W $996C4) * Ranged bonus now also applies to short-range attacks. (W $99B64) * Fixes bug : To Defend not only increases success chance of Defense Rolls, but also reduces chance of enemy melee Attack Rolls, thus providing over twice the expected benefit for Melee Attacks. (Prayer, Lucky bug W $99C3A) * Fixes bug: Weapon Immunity overrides Missile Immunity, preventing the latter from taking effect. (W $9A663) Introduces new bug: Weapon Immunity now raises Defense to instead of against non-melee weapon attacks ( and , also in v1.50) made by units with . * City Walls bonus in strategic combat will only be applied if the walls are built. Bonus reduced from to . (W $9A995) * Fixes bug, Regeneration prevents Word of Recall and Recall Hero from working properly. * The defender no longer loses all its remaining movement for the turn after combat. Due to turn order, this prevented the AI from using those units for the turn at all. (W $9D152) * A variable during calculation of movement allowance wasn't initialized during combat (W $9F151) * Charismatic now properly checks for gold before presenting the hero, item and mercenary offer : When owning 50 gold, offers costing 100 gold can show up which will then have an effective cost of 50, instead of being limited to offers of 50 gold which are reduced to 25 due to the retort. (W $A225D) New bug : when buying items, this change applies even to Artificer wizards, allowing them to buy items up to twice as expensive as they can afford. If bought, this results in negative remaining gold, causing various serious problems. * Chaos Channels will no longer overwrite ranged/thrown attacks on units with a Breath attack. (W $A4E5D) * Disenchant Area will no longer dispel own spells when used by heroes. (W $A9143) * Dispel-type spells no longer target the player's own unit spells when used by spellcasting units rather than a Wizard. (W $A9911) * Attempts to fix combat-cast having no effect against dispelling. Unfortunately still has no effect. (W $A9A6A) * Attempts to fix overland-cast not being possible to dispel in combat. Unfortunately, it still isn't. (W $A9DD6) * Fixes bug: dispel-type spells check the wrong player for the presence of for skipping the removal of combat-cast . (W $A9E46) * Attempts to fix combat-cast not being possible to dispel in combat. Unfortunately, it still isn't. (W $AA093) * New bug: can now be dispelled by its caster without reverting control of the unit. (W $AA5D4) * Partially fixes the memory corruption caused by casting - by redirecting that corruption to a fixed location containing sound error messages. (W $AB094) * Unknown fix in Animate Dead, probably a crash bug. (W $AB53A) * Fixes bug in Animate Dead, if enemy unit is animated, new owner is not set on the overland unit. (W $AB71D) * Unknown change to dialog/warning of casting Summon Hero and Summon Champion (not sure what the bug here was, but seems functionally equivalent) (W $ABA71) * Attempts to fix Wrack bug (x^2 damage instead of x damage), has no effect, might corrupt memory due to wrong addressing, uses ES instead of DS. ($AE2EA) * Fixes : Wraith Form provides immunity to Call Lightning instead of Magic Immunity. (W $AE4D5) * Suppress Magic no longer counters Spell of Return (W $B2A80) * Fixes unknown bug in the procedure that builds a list of the spells available for casting during combat, specifically the calculation of skill/mana available. (W $BC1FF) * New bug : Cities are unable to lose population if having higher population than the maximum. (W $C0F32) * Great Wasting and Armageddon no longer removes all pacifying effect of buildings. ($C2517) * Lo Pan has 1 fewer Sorcery books because the total picks was over 11. * The two heroes with no magical ranged attack cannot get Arcane Power (M $48018) AI changes * Changes to the preferences of building each building group both base and objective related, see : Objective for details. (W $2B4DD) * AI gains the ability to find items in treasure. In 1.31, they do not receive the items they found. (W $622EF) * Change of unknown purpose in the way AI compares the forces on its home continent for the old Military Modifier when looking for the Need for War (W $65AAF) * Minor change to the difficulty modifier used in AI to AI diplomacy (W $67b05) * AI minimum difficulty to for various features in diplomacy changed to match changes in difficulty levels (addition of Extreme, removal of Intro) * AI can unintentionally walk through units of other players, initiating combat, if relation is -20 or lower instead of -60 or lower, making the AI less smart and more aggressive. AI actually prefers doing so instead of moving through other tiles if the army in question is owned by the human player. (W $724DD) * AI is no longer allowed to flee during the first turn of combat. (W $7B8A1) * New bug : is ignored by the AI when deciding on what to target with . Hasted units with no other enchantments are now invalid targets for dispelling (W $81BC7) * AI can use the Healing Spell ability of units in combat. Breaks the display position of AI used Doom Bolt because one additional byte was accidentally deleted. (W $889F5) * A rather big part of AI combat code is disabled for an unknown reason. Disabled code was used when the AI had ranged superiority and it was significantly simpler than the normal AI, most likely resulting in significantly dumber decisions. (W $898A5) * Fixes : AI calculated total ranged power of armies in combat incorrectly (W $ 89795, $9E533) * Fixes bug: AI units with Illusions Immunity can't target Invisible units with Ranged Attacks. (W $8A2C3) * AI prefers to attack the more damaged enemy instead of the less damaged during combat. (W $8A6BC) * Removed additional upkeep discount for units received by the AI on the highest difficulty settings, as it already receives a major discount without this. ($96303) * Removed AI maintenance discount on building maintenance completely ($95E33) * During combat, AI will consider units exactly reachable in a turn as being too far, failing to prefer units that can be attacked, resulting in units walking around and ignoring enemies right next to them. (W $9BAD8) * AI prefers to attack more damaged units in combat if they can be reached that turn -note that the above change interferes with this improvement. ($9BAE8) * Fixes bug in how AI calculates total army strength in combat, used to base decisions - such as using spells or fleeing - on. (W $9EBE6) * Lawful wizards prefer to raze a city if Hidden Relation is equal to or less than zero instead of only when equal, meaning if they got betrayed previously. Since zero is the starting value, this should only happen is it strictly less than zero to have the intended effect. (W $9F90D) * AI wizards have a 10% lower chance to raze a city if was owned by another AI wizard. (W $9F968) * AI wizards now correctly prefer razing more if enemy forces are present in larger amount nearby, implying it's hard to keep the city, instead of the opposite, razing if own forces are superior. (W $9FA87) * AI will refuse offers from heroes if their ID is lower than the number of heroes they already own times 4, to preserve the slots for stronger heroes. (W $A2A40) * Fixes various bugs in AI use of Enchant Item and Create Artifact (W $B0FA4) * Changes to the AI table "priority of combat spell groups per combat situation". Defensive spells are now much less likely to be cast when the AI is losing, offensive buffs are more likely when at a slight advantage, and damage spells are less likely when the AI is winning. (W $B9C95) * Removes from the must-do top priority disenchant list. No change compared to v1.31, as the value set here was never actually used there. (W $B9DE8) * Fixed the AI looking at the wrong spell Realms for deciding on casting , , , , or in combat. Since the modifier for this is still 0, it ultimately has no effect. (W $B9DE6) * The AI has less chance of trying to cast in battle. Considering it is not even a combat spell, this has no actual effect. (W $B9EB2) * Changed the AI's category for (W $B9ED4), (W $B9ED4), (W $BA31A), (W $BA3A3), (W $BA3A3), (W $BA9A1), (W $BAC7F), (W $BAFEB), (W $BB1CE), and (W $BB285) to the group originally containing the offensive buffs, which is the most independent of the AI's comparison of its own army strength with that of the enemy - most of these changes are rather insignificant, except that of the two damage spells, which will now no longer be cast when the AI is at an overwhelming disadvantage. That is normally a bug. * New bug: the AI can no longer cast or if the human player has active. (W $BA125) * The AI has less chance of casting in combat. Unfortunately, since it is unable to do so anyway, this change has no actual effect. (W $BA818) * New bug: changed the AI's category for (W $BA9BA), (W $BAE5C), (W $BB350), (W $BB8C3), and (W $BB9C3); and the secondary categories of (W $BA588) and (W $BB0B4), from damage/destruction to unit curse, preventing them from being cast when the AI is at an overwhelming disadvantage. * The AI will not cast after turn 3 in combat. (W $BB01B) * gets a high casting priority if any type of wall is present. Unfortunately, this also introduces new bug: the AI can't cast this spell on its first turn when defending - the variable queried is not set up yet at its first spellcast. (W $BB096) * Changed the AI's category for from unit curse to defensive spell, making it slightly less likely to be cast overall. (W $BB14C) * The AI now considers an opposing or spell a must-do top priority to disenchant. (W $BB70D) * Changed the AI's category for (W $BB8AD), (W $BB8F5), (W $BB909), and (W $BB987) to the group originally containing the defensive spells - they are now less likely to be cast when losing. * The AI has an increased chance to cast (W $BB8CF) and . (W $BB947) * The AI is more likely to cast when there are more enemy Fantastic Units with an effective Resistance of or less against it - regardless of whether they are valid targets or not though. (W $BB94F) * AI considers Immolation a lower threat of Chaos Realm for casting protective spells in combat. (W $BBEC4) * AI estimated threat level of realm associated attacks in armies is cut to one quarter, reducing the chance of using protective spells greatly. (W $BC1A7) * AI is able to buy items from merchants. AI pays 50% of the normal price for items. (W $BE009) * Changes to how AI decides which unit needs to be disbanded for being obsolete (W $BF64F) * AI can first hire mercenaries 10 turns earlier (40 instead of 50) (W $CAAF7) * New AI decision procedure for hiring mercenaries (W $CAAFE) * Changes to how AI distributes the power base between Mana, Research and SKill (W $CB44D) * Changes to when and how much AI uses Alchemy. (W $CCC78) * Changes to how AI sets the tax rate. (W $CD0C4$) * AI is allowed keep 2 settlers or engineers instead of 1 past turn 200. (W $CD45A) * AI will not use previously chosen path for unit movement if distance is only 1 map cell (W $CE54D) * Changes to AI research selection (W $DC699) * AI will not cast expensive overland spells if it cannot afford it, instead doesn't cast a spell that turn (W $DCDAE) * Fixing the AI internal list of spell types known to select from (W $DDD3B) * Changes to preferences of various overland spells. ($DDE03) * When AI runs out of mana, it won't automatically cancel ALL global enchantments, only Suppress Magic and Time Stop ($E0D1C) * Changes how the AI selects targets for overland unit enchantments ($E1367), in general a major preference of heroes and anything at the fortress added. * AI moves the Summoning Circle more often. (W $E39F6) * AI will not buy production unless at least some of it is already done (W $E3FB6) * Fixes bug in AI decision to select Trade Goods for production. (W $E4017) * AI will not build settlers if population in city is 1 (W $E4163) * Changes AI's preferences of when to produce a unit vs a building (W $E429C) * Fixes other bugs and changes preferences of building production (W $E4321) * Neutral cities produce buildings slightly more often (W $E481D) * Changes to AI's production purchase decision (W $E4A3E) * Fixes various bugs in the AI assigning movement orders to units (W $E5226) * AI generally prefers keeping fewer defenders in cities and sending out larger amounts of units to build stacks, including the capital (W $E54DB defense, E9034 stack building) * When sending out units from the fortress to build stacks, send weakest instead of strongest but if the remainder for the current turn divided by 4 is 1, send strongest anyway. ($E90D4) * Changes to how AI uses settlers, contains new problems : Expansionist wizards will always prefer to settle the other plane even if they haven't settled their own, Settlers will never build if a unit of another wizard -even if ally!- is close. ($E9852) * When AI looks at strength of potential targets on the overland map for an attack, the human player's units are calculated at 25% of their effective strength instead of 125%, often resulting in unreasonable attacks from the AI. ($W7482) * AI will not immediately disband units if income is negative, unless gold or mana reserves are too low to afford the negative income for 32 turns. (W $E87D2) * Partial fix for AI units to board ships. (W $E6B2B) * AI is able to summon certain units they were unable to before on the overland map. * Changes to the AI's preference of spell picks at the start of the game. Also affects the default spells selected when the human player is starting the game. (M $27178) * The AI is allowed to pick any race on any difficulty instead of being restricted to the best races on high levels. (M $37140) * Fixed the guaranteed uncommon spell AI wizards get at hard or higher difficulty (was not received in Non-Nature realms if the wizard already had the Basilisk spell) * Changes to the effect retorts have on the AI wizard's Personality and Objective. Gameplay and interface changes * Unit view displays bonus To Hit and To Defend in the top right corner. To Hit was previously listed as an ability, and To Defend was hidden. (W : $10D4C) * Trireme and Galley has a transport capacity of 8. (W : $29B3C) * Cost of units to be placed in lair updated, but in the wrong file, so no effect. (W : $2AD7A) * Floating Island loses Death Immunity and gains the flag "display race" so it shows as "Sorcery Floating Island" in the game. Probably unintended. (W $2B10E) * Added Extreme difficulty (+300% bonus for AI resources), removed Intro difficulty. All difficulty levels are shifted below Extreme, but not everything is moved, due to this, some hardcoded exceptions based on Difficulty appear at 1 higher level than they should, for example 100% fleeing success rate of Intro and Easy instead applies to Easy and Normal. (W $2B48E) * Addition and change of various hotkeys (many locations). * Addition of new option : Revolting Raiders * Addition of new option : Monsters Gone Wild * "X" button on city screen moves to the next city (W $3AD39) * Removed option "End of turn wait" and "Auto Unit Info" they are always enabled. * Casting Nature Awareness automatically casts Detect Magic - New bug. Was probably intended for the RVL cheat and debugging but was left in the released version. (W $45AFD) * Unknown purpose change of the order units get autoselected on the overland map if towers are where they are standing. (W $471ED) * When entering an Encounter Zone, "many" is displayed if there are 4 or more of that type of enemy inside. (W $6247B) * New strategic combat bug : All units have an equal chance to take damage regardless of defense, unless they have 50+ def. I assume this was intended to weight damage better but was left incomplete. (W $7ECD4) * Spell Save modifier works with Life Drain (W 81FD3h) * Spell Save modifier works on Death Spell, Holy Word (W $82780) * Runemaster and True spells result in 4x total effectiveness instead of 6x for some spells : Dispel Magic True and Disenchant True. (W $82916) * Change to the Spell Save procedure, for unknown purpose, I assume for easier editing through the Tweaker. (W $84DFF) * Change to Conjurer maintenance discount rounding - cost to pay is going to be rounded down if effective cost is x-x.50 and up for x.75 instead of always up. (W $9682E) * Wind Mastery doubles ship speeds and does not slow down enemy ships. (W $98698) * Central squares of city behind City Walls adds as though the wall was intact there. ($W 99F2A) * units can gain after combat. (W $9D3AB) * spells appear in a more limited quantity in research options. (W $A2E49) * Changes to priorities of spells used when finding spells in a defeated wizard's fortress, or by the AI when trading. (W $A3148) * Merging provides immunity to Crack's Call (W$AA657) * Unknown changes for storing and reloading RND seeds. * Population growth is not reported if city size>8. (W $BDC6E) * Cap of chance for finding heroes increased to 20%. (W $BE959) * Changes to the generation of raiders and rampaging monsters. (W $E6B2B) * New landmass option : Huge. (M $30CF0) * New Magic Power options : 0.5 to 2.5 instead of the original Weak (0.5), normal (1) and Powerful (1.5) * Restricted the Y coordinate of the starting location for wizard towns to avoid the area that contains too much Tundra. Various other changes on how the fortresses are placed. * Minimal Max Population for fortress location increased from 8 to 12. This makes it possible for the generation to fail : on less optional maps, there might not be enough suitable areas. In this case the game freezes in a loop. * Base encounter budget for Normal Lairs increased by 200 on Arcanus and 150 on Myrror. (M $39584, $39598) * Encounter budget for Weak Lairs tripled on both Planes (multiplier changed from 10 to 30). (M $3967B) * Colored Lairs (Abandoned Keep, Dungeon, Monster Lair, and Mysterious Cave) now feature monsters 50% of the time. 1.31 code is botched and yields enemies all the time (instead of its intended ratio of 40% , 40% , and 20% ). (M $39951, $3996C, $3A151) * Divisor roll maximum range for secondary monsters in Encounter Zones reduced by 1 (9-count instead of 10-count). Slight increase in average secondary monster strength at the cost of a decrease in variety. (M $39B6F) * New bug : There are enchanted roads under the Arcanus starting cities. * Greatly increased cost reduction of Spell of Mastery for 11 book wizards. Category:Game Modifications